/**
 * Created by gh on 2016/10/2.
 */
$(function(){
    var mySwiper = new Swiper('.home-banner-swiper', {
        autoplay: 4000,
        loop:true,
        preloadImages:false,
        paginationClickable :true,
        pagination : '.home-banner-pagination'
    });
    var hotActivitySwiper = new Swiper('.hot-activity-swiper', {
        spaceBetween: 15,
        grabCursor : true,
        slidesPerView: "auto"
    });
    var designersSwiper = new Swiper('.designer-list-swiper', {
        spaceBetween: 15,
        grabCursor : true,
        slidesPerView: "auto"
    });
    $(".js-top-nav-check").click(function (e) {
        e.stopPropagation();
        $(".shadow-modal").show();
        $(".top-nav-drop-list").show();
    });
    $(".top-nav-drop-list").click(function (e) {
        e.stopPropagation();
    });
    $(document).click(function () {
        $(".shadow-modal").hide();
        $(".top-nav-drop-list").hide();
    });
    $(".btn-close-top-nav").click(function () {
        $(".shadow-modal").hide();
        $(".top-nav-drop-list").hide();
    });
    /*装修预算的弹窗*/
    $(".js-submit-budget-info").click(function () {
        $(".budget-modal.budget-result-sure").show();
    });
    $(".budget-modal").click(function () {
        $(".budget-modal").hide();
    });
    $(".btn-close-budget-modal").click(function () {
        $(".budget-modal").hide();
    });
    $(".budget-alert-box").click(function (e) {
        e.stopPropagation();
    });
    /*多行文本，超出的显示省略号*/
    $(".multi-ellipsis").each(function(index,ele){
        var _row=$(ele).attr("data-row");
        $(ele).ellipsis({
            row:_row
        })
    });
    /*popular village*/
    var villageSwiper = new Swiper('.village-banner-swiper', {
        autoplay: 4000,
        loop:true,
        preloadImages:false,
        grabCursor : true,
        pagination : '.home-banner-pagination'
    });
    /*区域选择的点击效果*/
    $(".village-select-option-list li a").click(function () {
        $(this).parent().parent().parent().find("li").removeClass("active");
        $(this).parent("li").addClass("active");
    })
})
